package com.ibeeking.found.common.enums;

public enum ActivityContentEnum {
    COUPON("优惠券", 0),
    GOODS("商品", 1);

    private String name;
    private Integer code;

    ActivityContentEnum(String name, Integer code) {
        this.name = name;
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public Integer getCode() {
        return code;
    }

    public static String getNameByCode(Integer code) {
        for (ActivityContentEnum enumObj : values()) {
            if (enumObj.getCode().equals(code)) {
                return enumObj.getName();
            }
        }
        return null;
    }

    public static ActivityContentEnum getEnumByCode(Integer code) {
        for (ActivityContentEnum enumObj : values()) {
            if (enumObj.getCode().equals(code)) {
                return enumObj;
            }
        }
        return null;
    }
}
